# program input:


# program output:

# program purpose:

# notes:
# maybe need some final clean up.

inputFileName = "/data3/obukai/the_new_trip_of_feature_generation/gov2ClearYourMindAndDoItAgain/pruningProjectResults/top-10000-AND-Semantics-Pruning-PartialBM25/100KPlus147Queries/gold_standard_results/results_BM25Scores_100%"
inputFileHandler = open(inputFileName,"r")

outputFileName = "/data3/obukai/the_new_trip_of_feature_generation/gov2ClearYourMindAndDoItAgain/pruningProjectResults/top-10000-AND-Semantics-Pruning-PartialBM25/100KPlus147Queries/gold_standard_results/results_BM25Scores_100%_trec_eval_compatible"
outputFileHandler = open(outputFileName,"w")

for i in range(0,8):
    inputFileHandler.readline()
    
    
currentLine = inputFileHandler.readline()

while currentLine:
    print "currentLine:",currentLine.strip()
    lineElements = currentLine.strip().split("\t")
    print "len(lineElements):",len(lineElements)
    if len(lineElements) == 6:
        outputFileHandler.write(lineElements[0] + " " + "0" + " " + lineElements[2] + " " + "2" + "\n")  
      
    currentLine = inputFileHandler.readline()
'''
for line in inputFileHandler.readlines():
    lineElements = line.strip().split(" ")
    if len(lineElements) == 6:
        outputFileHandler.write(lineElements[0] + " " + "0" + " " + lineElements[2] + " " + "2" + "\n")
'''
    
inputFileHandler.close()
outputFileHandler.close()